package com.xcm.dao;

import org.apache.ibatis.annotations.Param;

import com.xcm.model.TbProgramDownload;

/**
 * 节目下载信息
 */
public interface ProgramDownloadMapper {
	/**
	 * 保存节目下载信息
	 *
	 * @param programDownload TbProgramDownload对象
	 */
	void saveProgramDownload(TbProgramDownload programDownload);
	/**
	 * 更新节目下载信息
	 *
	 * @param programDownload TbProgramDownload对象
	 */
	void updateProgramDownload(TbProgramDownload programDownload);
	
	/**
	 * 多条件查询节目下载状态计数
	 * @param state 状态
	 * @param xcVersion 
	 * @param mac  
	 * @return
	 */
	long countProgramDownStatus(@Param("state")Integer state, @Param("xcVersion")String xcVersion,@Param("mac") String mac);
	
	/**
	 * 根据mac和xcVersion获取下载状态记录
	 * @param mac
	 * @param downloadJson
	 * @return
	 */
	TbProgramDownload getProgramDownloadByMacAndXcVersion(@Param("mac") String mac, @Param("xcVersion")String xcVersion);
}
